haystack=""
needle=""
#子串匹配问题
def strStr(haystack,needle):
    if needle=="":
        return 0
    #左右指针
    haystack_l_pointer,haystack_r_pointer=0,len(needle)-1
    while haystack_r_pointer<len(haystack):
        sub_str=haystack[haystack_l_pointer:haystack_r_pointer+1]
        if sub_str==needle:
            return haystack_l_pointer
        else:
            haystack_l_pointer+=1
            haystack_r_pointer+=1
    return -1
print(strStr(haystack,needle))